import { FC } from "react";
import styled from "styled-components";

// 基础组件
const Button = styled.button`
  padding: 12px 24px;
  background: ${(props) => (props.primary ? "#1890ff" : "#f5f5f5")};
  color: ${(props) => (props.primary ? "white" : "#333")};
  border-radius: 4px;
  &:hover {
    opacity: 0.8;
  }
`;

// 继承样式
const LargeButton = styled(Button)`
  padding: 16px 32px;
  font-size: 18px;
`;

const Demo: FC = () => (
  <div>
    <Button>默认按钮</Button>
    <Button primary>主按钮</Button>
    <LargeButton>大按钮</LargeButton>
  </div>
);

export default Demo;
